{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
    {if condition="$id eq 0"}
    <h3 class="pb-3">新增常规样品评定测量</h3>
    <table class="layui-table layui-table-form">
        <tr>
            <td class="layui-td-gray-2">样品<font>*</font></td>
            <td colspan="2">
                <input type="text" name="nums"  lay-verify="required" placeholder="请输入样品"  class="layui-input" value="" >
            </td>

        </tr>
        <tr>
            <td class="layui-td-gray-2">重复1<font>*</font></td>
            <td colspan="2">
                <input type="text" name="data1"  lay-verify="required" placeholder="请输入重复1"  class="layui-input" value="" >
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">重复2<font>*</font></td>
            <td colspan="2">
                <input type="text" name="data2"  lay-verify="required" placeholder="请输入重复2"  class="layui-input" value="" >
            </td>
        </tr>
    </table>
    {else/}
    <h3 class="pb-3">修改常规样品评定测量</h3>
    <table class="layui-table layui-table-form">
        <tr>
            <td class="layui-td-gray-2">样品<font>*</font></td>
            <td colspan="2">
                <input type="text" name="nums"  lay-verify="required" placeholder="请输入样品"  class="layui-input" value="{$data.nums}" >
            </td>

        </tr>
        <tr>
            <td class="layui-td-gray-2">重复1<font>*</font></td>
            <td colspan="2">
                <input type="text" name="data1"  lay-verify="required" placeholder="请输入重复1"  class="layui-input" value="{$data.data1}" >
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">重复2<font>*</font></td>
            <td colspan="2">
                <input type="text" name="data2"  lay-verify="required" placeholder="请输入重复2"  class="layui-input" value="{$data.data2}" >
            </td>
        </tr>

    </table>
    {/if}

    <div class="py-3">
        <input type="hidden" name="id" value="{$id}" />
        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
    const moduleInit = ['tool'];
    function gouguInit() {
        var form = layui.form,tool=layui.tool,upload = layui.upload;

        //监听提交
        form.on('submit(webform)', function (data) {
            let callback = function (e) {
                layer.msg(e.msg);
                if (e.code == 0) {
                    setTimeout(function () {
                        parent.location.reload();
                    }, 1000);
                }
            }
            tool.post("/webadmin/jingmidu/add", data.field, callback);
            return false;
        });
    }
</script>
{/block}
<!-- /脚本 -->
